package cn.edu.sicau.databasepp.entity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "user_role", schema = "sqlexcise", catalog = "")
public class UserRoleEntity
{
    private long roleId;
    private String theRole;

    @Id
    @Column(name = "role_id", nullable = false)
    public long getRoleId()
    {
        return roleId;
    }

    public void setRoleId(long roleId)
    {
        this.roleId = roleId;
    }

    @Basic
    @Column(name = "the_role", nullable = true, length = 8)
    public String getTheRole()
    {
        return theRole;
    }

    public void setTheRole(String theRole)
    {
        this.theRole = theRole;
    }

    @Override
    public boolean equals(Object o)
    {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserRoleEntity that = (UserRoleEntity) o;
        return roleId == that.roleId &&
                Objects.equals(theRole, that.theRole);
    }

    @Override
    public int hashCode()
    {
        return Objects.hash(roleId, theRole);
    }
}
